package com.neborosoft.FlyingDog.android.playing.modes;

import android.app.Activity;
import com.neborosoft.FlyingDog.R;
import com.neborosoft.FlyingDog.android.gui.adapters.listview.CountriesListAdapter;
import com.neborosoft.FlyingDog.logic.database.providers.CountriesTree;
import com.neborosoft.android.gui.adapters.listview.ViewArrayAdapter;
import com.neborosoft.android.gui.wrappers.ListViewSwitcher;
import com.neborosoft.lib.collections.tree.MultiStepsNavigationTree;

/**
 * Project: FlyingDog
 * User: stikhonenko
 * Date: 3/7/13
 * Time: 6:51 PM
 */
public class CountriesMode extends GenresMode{
    public CountriesMode(Activity activity, ListViewSwitcher listViewSwitcher, MultiStepsNavigationTree tree) {
        super(activity, listViewSwitcher, tree);
    }

    @Override
    protected Class<? extends ViewArrayAdapter> getListViewAdapterClass(int level) {
        if(level != CountriesTree.TAGS_LEVEL){
            return super.getListViewAdapterClass(level - 1);
        }

        return CountriesListAdapter.class;
    }

    @Override
    protected int getStepsCountByTabId(int tabId) {
        if(tabId == R.id.songsOfCountryTab){
            return CountriesTree.STEPS_COUNT_FROM_TAGS_TO_SONGS;
        } else if(tabId == R.id.artistsOfCountryTab) {
            return CountriesTree.STEPS_COUNT_FROM_TAGS_TO_ARTISTS;
        } else {
            return MultiStepsNavigationTree.DEFAULT_STEPS_COUNT;
        }
    }

    @Override
    protected int getTabsResourceId() {
        return R.id.countriesTabs;
    }

    @Override
    protected int getListViewResourceIdForLevel(int level) {
        if(level == CountriesTree.ARTISTS_LEVEL ||
                level == CountriesTree.ALBUMS_LEVEL){
            return Constants.gridViewSwitcherResource;
        }

        return Constants.listViewSwitcherResource;
    }
}
